package com.complaint.rest.user.dto;

import com.complaint.rest.user.validation.PasswordsNotEmpty;
import com.complaint.rest.user.validation.PasswordsNotEqual;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * Created by Alex
 */
@PasswordsNotEmpty(
        passwordFieldName = "password",
        passwordVerificationFieldName = "passwordVerification"
)
@PasswordsNotEqual(
        passwordFieldName = "password",
        passwordVerificationFieldName = "passwordVerification"
)
public class RegistrationForm implements Serializable {

    @Email(message = "Email address not valid")
    @NotEmpty(message = "Email should not be empty")
    @Size(max = 100, message = "Email should not exceed 100 characters")
    private String email;

    @NotEmpty(message = "First name should not be empty")
    @Size(max = 100, message = "First name should not exceed 100 characters")
    private String firstName;

    @NotEmpty(message = "Last name should not be empty")
    @Size(max = 100, message = "First name should not exceed 100 characters")
    private String lastName;

    private String password;

    private String passwordVerification;

    public RegistrationForm() {

    }

    public boolean isNormalRegistration() {
        return true;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPasswordVerification() {
        return passwordVerification;
    }

    public void setPasswordVerification(String passwordVerification) {
        this.passwordVerification = passwordVerification;
    }
}
